{% extends "common/layout_main.html" %}
{% block content %}
    <div class="row  border-bottom">
        <div class="col-lg-12">
            <div class="tab_title">
                <ul class="nav nav-pills">
                    <li class="current">
                        <a href="{{ buildUrl('/member/index') }}">会员列表</a>
                    </li>
                    <li>
                        <a href="{{ buildUrl('/member/comment') }}">会员评论</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <form class="form-inline wrap_search">
                <div class="row  m-t p-w-m">
                    <div class="form-group">
                        <select name="status" class="form-control inline">
                            <option value="-1">请选择状态</option>
                            <option value="1">正常</option>
                            <option value="0">已删除</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <input type="text" name="mix_kw" placeholder="请输入关键字" class="form-control" value="">
                            <span class="input-group-btn">
                            <button type="button" class="btn  btn-primary search">
                                <i class="fa fa-search"></i>搜索
                            </button>
                        </span>
                        </div>
                    </div>
                </div>
                <hr>
            </form>
            <table class="table table-bordered m-t">
                <thead>
                <tr>
                    <th>头像</th>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {% if  member_list %}
                    {% for item in member_list %}
                        <tr>
                            <td><img alt="image" class="img-circle" src="{{ item.avatar }}"
                                     style="width: 40px;height: 40px;"></td>
                            <td>{{ item.nickname }}</td>
                            <td>{{ item.sex_desc }}</td>
                            <td>{{ item.status_desc }}</td>
                            <td>
                                <a href="{{ buildUrl('/member/info') }}?id={{ item.id }}">
                                    <i class="fa fa-eye fa-lg"></i>
                                </a>
                                {# 原版 #}
                                {# 编辑账号控件 #}
                                {#                        <a class="m-l" href="{{ buildUrl('/member/set') }}?id={{ item.id }}">#}
                                {#                            <i class="fa fa-edit fa-lg"></i>#}
                                {#                        </a>#}

                                {# 删除会员账号控件 #}
                                {#                        <a class="m-l remove" href="javascript:void(0);" data="{{ item.id }}">#}
                                {#                            <i class="fa fa-trash fa-lg"></i>#}
                                {#                        </a>#}

                                {# 加入删除状态版本 #}
                                {% if item.status == 1 %} {# 未删除状态 #}
                                    <a class="m-l" href="{{ buildUrl('/member/set') }}?id={{ item.id }}">
                                        <i class="fa fa-edit fa-lg"></i>
                                    </a>
                                    <a class="m-l remove"
                                       href="javascript:void(0);" data="{{ item.id }}">
                                        <i class="fa fa-trash fa-lg"></i>
                                    </a>
                                {% else %}
                                    <a class="m-l recover"
                                       href="javascript:void(0);" data="{{ item.id }}">
                                        <i class="fa fa-rotate-left fa-lg"></i>
                                    </a>
                                {% endif %}

                            </td>
                        </tr>
                    {% endfor %}
                {% else %}
                    <td colspan="5">暂无数据~</td>
                {% endif %}
                </tbody>
            </table>
            <!--分页代码已被封装到统一模板文件中-->
            <div class="row">
                <div class="col-lg-12">
                    <span class="pagination_count" style="line-height: 40px;">共1条记录 | 每页50条</span>
                    <ul class="pagination pagination-lg pull-right" style="margin: 0 0 ;">
                        <li class="active"><a href="javascript:void(0);">1</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{# 删除账号使用ajax异步请求，关联其js #}
{% block js %}
    <script src="{{ buildStaticUrl('/js/member/index.js') }}"></script>
{% endblock %}